package com.cdl.iheritance;

import java.time.LocalDate;

/**
 * @author cdl
 * @date 2025/10/3
 */
public class Employee {

    private String name;
    private double salary;
    private LocalDate hireDay;

    /**
     *
     * @param name 名称
     * @param salary 工资
     * @param year 年
     * @param month 月
     * @param day 日
     */
    public Employee(String name,double salary,int year,int month, int day){
        this.name = name;
        this.salary = salary;
        this.hireDay = LocalDate.of(year,month,day);
    }
    public String getName(){
        return name;
    }
    public double getSalary(){
        return salary;
    }
    public LocalDate getHireDay(){
        return hireDay;
    }

    /**
     * 增加工资
     * @param byPercent 比例 如：10；
     */
    public void raiseSalary(double byPercent){
        double raise = salary*byPercent /100;
        salary += raise;
    }

}
